package org.abacus.standard;

import java.io.UnsupportedEncodingException;
import java.util.Arrays;

import org.junit.Test;

public class Base64CoderTest {

	@Test
	public void encodeTest() throws UnsupportedEncodingException {
		System.out.println(Integer.toString((-27), 2));
		System.out.println(Integer.toString((-27 & 0X03), 2));
		System.out.println(Integer.toString(-123, 2));
		System.out.println(Integer.toString(-123 >> 4, 2));
		System.out.println(Integer.toString((-123 & 0XF0), 2));
		System.out.println(Integer.toString(0XF0, 2));
		System.out.println(Integer.toString(-123 & 0XF0 >> 4, 2));
		// System.out.println((char) 10);
		String d = "\",入户ssssssssssssssssssssssssssssss-1";

 		d += d;
//		d += d;
//		d += d;
//		d += d;
//		d += d;
		byte[] arg0 = d.getBytes();// 入户ssss

		arg0 = d.getBytes();
		System.out.println(Arrays.toString(arg0));
		// arg0 = "uu".getBytes();
		String bytes = Base64Coder.encode(arg0, true);

		System.out.println(new String(bytes.getBytes(), "GBK"));

		System.out.println(new String(arg0));

		System.out.println(Base64Coder.decode(bytes.getBytes()));
		// System.out.println(BASE64Encoder.encode(arg0));

	}
}
